<?php
namespace iBrand\Component\Point\Listeners;

use iBrand\Component\Point\Repository\PointRepository;

class PointEventListener
{
    private $point;

    public function __construct(PointRepository $pointRepository)
    {
        $this->point = $pointRepository;
    }

    public function onPointChange($uid)
    {
        $this->point->updateUserPoint($uid);
    }

    public function onUserLogin(){

    }

    public function subscribe($events)
    {
        $events->listen(
            'point.change',
            'iBrand\Component\Point\Listeners\PointEventListener@onPointChange'
        );

        /*$events->listen(
            'Illuminate\Auth\Events\Login',
            'iBrand\Component\Point\Listeners\LogSuccessfulLogin'
        );

        $events->listen(
            'complete_info',
            'iBrand\Component\Point\Listeners\UpdateProfile'
        );

        $events->listen(
            'verify_mobile',
            'iBrand\Component\Point\Listeners\VerifyMobile'
        );*/
    }
}